package com.bailan.foreat.service.impl;

import com.bailan.foreat.entity.Comment;
import com.bailan.foreat.mapper.CommentMapper;
import com.bailan.foreat.service.CommentService;
import com.bailan.foreat.vo.CommentVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ste
 * @since 2023-02-21 07:50:43
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {

    @Autowired
    CommentMapper commentMapper;

    @Override
    public IPage selectAll(Integer currentPage, Integer pageSize, Integer productId) {
        Page page=new Page<>(currentPage,pageSize);
        IPage<CommentVo> commentVoRl=commentMapper.selectByProductId(page,productId);
        return commentVoRl;
    }
}
